package slxy.jiangtao.dts.entity.sys;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.SQLDelete;
import org.jeecgframework.poi.excel.annotation.Excel;
import slxy.jiangtao.dts.core.common.bean.BaseId;
import slxy.jiangtao.dts.core.common.bean.Constants;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Code must be sexy
 * Created by JiangTao on 2017/1/12.
 * <p>
 * 社员实体
 */
@Entity
@Table(name = "user", schema = "dts")
@DynamicInsert
@SQLDelete(
        sql ="UPDATE user SET statu = "
                        + Constants.STATU_FLAG_Leave
                        + " WHERE id = ?"
)
public class User extends BaseId{
    @Column(name = "no",nullable = false)
    @Excel(name = "学号")
    private String no;

    @Column(name = "name",nullable = false)
    @Excel(name = "姓名")
    private String name;

    @Column(name = "password")
    private String password;

    @Column(name = "email")
    @Excel(name = "邮箱")
    private String email;

    @Column(name = "banji")
    @Excel(name = "班级")
    private String banji;

    @Column(name = "statu")
    private Integer statu;

    @Column(name = "major_id")
    private Integer majorId;

    @Column(name = "college_id")
    private Integer collegeId;

    @Column(name = "phone")
    @Excel(name = "电话")
    private String phone;

    @Column(name = "depart_id")
    private Integer departId;

    @Column(name = "image")
    private String image;

    @Column(name = "remark")
    private String remark;

    @Column(name = "role_id")
    private Integer roleId;

    @Column(name = "user_type")
    private String userType;

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getStatu() {
        return statu;
    }

    public void setStatu(Integer statu) {
        this.statu = statu;
    }


    public Integer getMajorId() {
        return majorId;
    }

    public void setMajorId(Integer majorId) {
        this.majorId = majorId;
    }

    public Integer getDepartId() {
        return departId;
    }

    public void setDepartId(Integer departId) {
        this.departId = departId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }


    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Integer getCollegeId() {
        return collegeId;
    }

    public void setCollegeId(Integer collegeId) {
        this.collegeId = collegeId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getBanji() {
        return banji;
    }

    public void setBanji(String banji) {
        this.banji = banji;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }


    /** 拥有的菜单 */
    /*@ManyToMany(targetEntity = Role.class,fetch=FetchType.LAZY)
    @JoinTable(
            name = "user_role",
            joinColumns = @JoinColumn(name = "user_id"),
            inverseJoinColumns = @JoinColumn(name = "role_id")
    )
    private List<Role> roleList;
    public List<Role> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<Role> roleList) {
        this.roleList = roleList;
    }*/

    /***
     * 部门ID
     * @return
     */
    /*@ManyToOne
    @JoinColumn(name = "depart_id", nullable = false, insertable = false, updatable = false)
    private Depart depart;

    public Depart getDepart() {
        return depart;
    }

    public void setDepart(Depart depart) {
        this.depart = depart;
    }*/
}
